package com.longjianghuasheng.logistics.business.grab_an_order

import androidx.lifecycle.MutableLiveData
import com.longjianghuasheng.logistics.base.BaseMultiStateViewModel
import com.longjianghuasheng.logistics.data.model.bean.ApiResponseNoData
import com.longjianghuasheng.logistics.entity.DriverFormListResponse
import com.longjianghuasheng.logistics.ext.commit2
import com.longjianghuasheng.logistics.network.apiService

class GrabAnOrderViewModel : BaseMultiStateViewModel() {

    var id = 0
    val result by lazy {
        MutableLiveData<DriverFormListResponse>()
    }

    val notify by lazy {
        MutableLiveData<ApiResponseNoData>()
    }

    fun requestData() {
        getData({ apiService.driver_form_list(page) }, result)
    }


    fun driver_do() {
        commit2({ apiService.driver_do(id) }, notify)
    }
}